#include <rclcpp/rclcpp.hpp>

class MultiThreadExecutorNode : public rclcpp::Node {
public:
  MultiThreadExecutorNode() : Node("multi_thread_executor_node") {
    timer1_ = this->create_wall_timer(std::chrono::seconds(3), [this]() {
      RCLCPP_INFO(this->get_logger(), "Timer 1 is triggered");
    });
    timer2_ = this->create_wall_timer(std::chrono::seconds(1), [this]() {
      RCLCPP_INFO(this->get_logger(), "Timer 2 is triggered");
    });
  }

private:
  rclcpp::TimerBase::SharedPtr timer1_;
  rclcpp::TimerBase::SharedPtr timer2_;
};

int main(int argc, char *argv[]) {
  rclcpp::init(argc, argv);
  auto node = std::make_shared<MultiThreadExecutorNode>();
  rclcpp::executors::MultiThreadedExecutor executor;
  executor.add_node(node);
  executor.spin();
  rclcpp::shutdown();
  return 0;
}